package designmode.Observer.v2;

import java.util.Random;

/**
 * Created by Administrator on 2017/10/30 030.
 */
public class test
{
    public static void main(String[] args)
    {
        WeatherData data = new WeatherData();
        LEDDisplay ld = new LEDDisplay(data);
        OLEDDisplay od = new OLEDDisplay(data);

        new Thread()
        {
            int c;
            Random rd = new Random();

            @Override
            public void run()
            {
                while (c++ < 50)
                {
                    try
                    {
                        Thread.sleep(200);
                        data.measureDataResult(rd.nextFloat() * 100, rd.nextFloat() * 100, rd.nextFloat() * 100);
                    } catch (InterruptedException e)
                    {
                        e.printStackTrace();
                    }
                }
            }
        }.start();
    }
}
